import request from '@/request'

export function findAll() {
    return request.post("role/findAll");
}

export function findOne(roleId) {
    return request.post("role/findOne",roleId,request.textConfig);
}

export function doSaveOrUpdate(data) {
    let path = data.roleId ? "update" : "save";
    return request.post(`role/${path}`, data);
}

export function deleteByroleId(roleId) {
    return request.post("role/delete",roleId,request.textConfig);
}

export function distPermToRole(roleId,permissionIds){
    return request.post("role/distPermToRole",{"roleId":roleId,"permissionIds":permissionIds});
}